<% add_decidim_page_title(t(".title")) %>
<div class="item_show__header">
  <h1 class="item_show__header-title">
    <%= t("decidim.admin_log.helpers.answers") %>
  </h1>
</div>

<div class="item__edit item__edit-1col">
  <div class="item__edit-form">
    <%= render partial: "info_initiative", locals: { initiative: current_initiative } %>

    <%= decidim_form_for(@form, url: initiative_answer_path(current_initiative), html: { class: "form-defaults form edit_initiative_answer" }) do |f| %>
      <div class="form__wrapper">
        <div class="card">
          <div class="card-divider">
            <h2 class="card-title"><%= t ".title", title: translated_attribute(current_initiative.title) %></h2>
          </div>

          <div class="card-section">
            <div class="row column">
              <%= f.translated :editor, :answer, autofocus: true, rows: 15 %>
            </div>

            <div class="row column">
              <%= f.text_field :answer_url %>
            </div>

            <% if @form.signature_dates_required? %>
              <div class="row">
                <div class="columns">
                  <%= f.date_field :signature_start_date, disabled: !@form.signature_dates_required? %>
                </div>

                <div class="columns">
                  <%= f.date_field :signature_end_date, disabled: !@form.signature_dates_required? %>
                </div>
              </div>
            <% end %>
          </div>
        </div>
      </div>
      <div class="item__edit-sticky">
        <div class="item__edit-sticky-container">
          <%= f.submit t(".answer"), class: "button button__sm button__secondary" %>
        </div>
      </div>
    <% end %>
  </div>
</div>
